#////////////////////////////////////////////////////////////////////////////
#//
#// Author      : Luis M. de la Cruz Salas
#// Last Mod.   : Thu Oct 14 14:32:11 CDT 2010
#//
#////////////////////////////////////////////////////////////////////////////
#//
#// Name        :  Makefile
#////////////////////////////////////////////////////////////////////////////

include	../../tuna-cfd-rules.in

NVCC = $(CUDA)/bin/nvcc
CUDA = /usr/local/cuda
CUDA_INCLUDE = $(CUDA)/include
CUDA_LIB = $(CUDA)/lib64
INCLUDEGPU = -I$(CUDA_INCLUDE)
LIBGPU = -L$(CUDA_LIB) -lglfw -lGL

all :	line_condif_01 line_condif_02 plane_condif_02 

concentracionGLFW.o:	concentracionGLFW.cu 
	$(NVCC) -I$(CUDA_INCLUDE) -c $< 

concentracionGLFWCU.o:	concentracionGLFWCU.cu 
	$(NVCC) -I$(CUDA_INCLUDE) -c $< 

line_condif_01GPU: line_condif_01GPU.o concentracionGLFW.o
	$(CXX) $(CXXFLAGS) $(INCLUDES) $(INCLUDEGPU) $< concentracionGLFW.o -o $@ $(LIBS)  $(LIBGPU) -lcudart

line_condif_01GPU.o: line_condif_01GPU.cpp
	$(CXX) $(CXXFLAGS) $(INCLUDES) $(INCLUDEGPU) -c $<

line_condif_01GPUCU: line_condif_01GPU.o concentracionGLFWCU.o
	$(CXX) $(CXXFLAGS) $(INCLUDES) $(INCLUDEGPU) $< concentracionGLFWCU.o -o $@ $(LIBS)  $(LIBGPU) -lcudart

line_condif_01: line_condif_01.o 
	$(CXX) $(CXXFLAGS) $(INCLUDES) $< -o $@ $(LIBS)

line_condif_01.o: line_condif_01.cpp
	$(CXX) $(CXXFLAGS) $(INCLUDES) -c $<

line_condif_02: line_condif_02.o 
	$(CXX) $(CXXFLAGS) $(INCLUDES) $< -o $@ $(LIBS)

line_condif_02.o: line_condif_02.cpp
	$(CXX) $(CXXFLAGS) $(INCLUDES) -c $<

plane_condif_02: plane_condif_02.o 
	$(CXX) $(CXXFLAGS) $(INCLUDES) $< -o $@ $(LIBS)

plane_condif_02.o: plane_condif_02.cpp
	$(CXX) $(CXXFLAGS) $(INCLUDES) -c $<

lengthPDF: lengthPDF.o 
	$(CXX) $(CXXFLAGS) $(INCLUDES) $< -o $@ $(LIBS)

lengthPDF.o: lengthPDF.cpp
	$(CXX) $(CXXFLAGS) $(INCLUDES) -c $<

clean:
	/bin/rm -f  *~ concentracionGLFW.o concentracionGLFWCU.o line_condif_01GPU.o line_condif_01GPU line_condif_01GPUCU.o line_condif_01GPUCU line_condif_01.o line_condif_01 line_condif_02.o line_condif_02 plane_condif_02.o plane_condif_02 lengthPDF.o lengthPDF
